#include "StdAfx.h"
#include "DxPixelShader.h"
#include "D3DX9Shader.h"
#include "DxRenderer.h"


DxPixelShader::DxPixelShader(void)
{
	m_pPixelShader = 0;
}


DxPixelShader::~DxPixelShader(void)
{
	m_pPixelShader->Release();
}

bool DxPixelShader::LoadFromFile(char* szPath, DxRenderer* renderer)
{
	char* shader = LoadShaderData(szPath);

	if( shader )
	{
		renderer->GetDevice()->CreatePixelShader((DWORD*)shader, &m_pPixelShader);
		delete shader;
		return true;
	}

	return false;

}